<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ page import="com.msmall.base.util.ConstantDB" language="java"%>
<c:set var="FROM_TRANSFER" value="<%=ConstantDB.FROM_TRANSFER%>"></c:set>
<c:set var="FROM_ORIGINAL" value="<%=ConstantDB.FROM_ORIGINAL%>"></c:set>

<script type="text/javascript" charset="utf-8" src="${ctx}/editor/kindeditor-min.js"></script>
<div class="dirbar">
	<a href="<c:url value='/home.do'/>"><span>首页</span></a> 
	>> <a href="<c:url value='/bbs/index.do'/>"><span>论坛</span></a>  
	>> <a href="<c:url value='/bbs/bi.do?bid=${board.boardId }'/>"><span>${board.chineseName}</span></a> 
	>> 发表新帖子
</div>	
<div class="ntopic">
	<div class="ntopic_auther">
		<span>作&nbsp;&nbsp;者:</span><c:out value="${nickname}"></c:out>
	</div>
	<form id="f_new_topic" action="<c:url value='/bbs/st.do'/>" method="POST" >
		<input type="hidden" name="bid" value="${bid }"/>
		<span>标&nbsp;&nbsp;题:</span>
		<input id="topic_title" name="topic.title" value="${topic.title}" size="40" class="input"/>
		&nbsp;&nbsp;
		<select name="topic.keywordid" size="1" class="input">
			<c:set var="keywords" value="${board.keywords}"/>
			<c:forEach var="keyword" items="${keywords}" varStatus="status1">
				<option value="${keyword.keywordid}" <c:if test="${topic.keywordid == keyword.keywordid}">selected="selected"</c:if>>
					<c:out value="${keyword.title}"/>
				</option>
			</c:forEach>
		</select>
		<br/>
		<span>内&nbsp;&nbsp;容:</span>
		<br/>
		<c:if test="${not empty message}">
			<div id="div_topic_error" class="div_topic_error" style="display:block"><c:out value="${message}"/></div>
		</c:if>
		<textarea id="topic_content" name="topic.content" rows="200" cols="80" style="width:750px;height:400px"><c:out value='${topic.content}'/></textarea>
		<br/>
		<select name="topic.original" size="1" class="input">
			<option value="${FROM_ORIGINAL}" <c:if test="${topic.original == FROM_ORIGINAL}">selected="selected"</c:if>>原创</option>
			<option value="${FROM_TRANSFER}" <c:if test="${topic.original == FROM_TRANSFER}">selected="selected"</c:if>>转载</option>
		</select>
		<br/>
		<button class="btn1" type="submit" name="submitTopic">发表</button>
	</form>
</div>
<script type="text/javascript">
KE.show({
	id : 'topic_content',
	imageUploadJson : ctx+'/h/keditor.do',
	fileManagerJson : ctx + '/editor/jsp/file_manager_json.jsp',
	allowFileManager : true,
	afterCreate : function(id) {
		KE.event.ctrl(document, 13, function() {
			KE.util.setData(id);
			document.forms['topic_content'].submit();
		});
		KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
			KE.util.setData(id);
			document.forms['topic_content'].submit();
		});
	}
});
</script>